import React, { Component } from 'react';

class App extends Component {
  render() {
    return (
      <div>
        <h1>App组件</h1>
        <h2>嘿嘿</h2>
        <h3>哈哈</h3>
        <h4>{this.props.msg}</h4>
        {this.props.handerClick()}
      </div>
    );
  }
}
function HOC(WarpedComponent){
  return class Dome extends Component{
    handerClick=(params) => {
      alert('我出来啦')
    }
    render (){  
      let newProps={
        msg:'呵呵',
      }
      return <WarpedComponent {...newProps} handerClick={this.handerClick}></WarpedComponent>
    }
  }
}
export default HOC(App);
